//创建用户集合
//引入mongoose模块
const mongoose = require('mongoose')
mongoose.set('useCreateIndex', true)
// mongoose.connect("mongodb://localhost/blog",{ useNewUrlParser: true ,useUnifiedTopology: true} )
mongoose.connect("mongodb://xdj:123456@localhost:27017/blog?authSource=admin",{ useNewUrlParser: true ,useUnifiedTopology: true} )
  .then(()=>{console.log('连接数据库成功')})
  .catch(()=>{console.log('连接数据库失败')})